package com.example.vocab.service.impl;

import com.example.vocab.dao.WordDao;
import com.example.vocab.entity.MyWord;
import com.example.vocab.entity.Word;
import com.example.vocab.service.WordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WordServiceImpl implements WordService {

    @Autowired
    WordDao wordDao;

    @Override
    public List<Word> getWord() {

        List<Word> words = wordDao.getWord();
        return words;
    }

    @Override
    public Integer getFrequencyByWid(Integer wid) {
        Integer frequency = wordDao.getFrequencyByWid(wid);
        return frequency;
    }

    @Override
    public Integer addMyWord(int uid, int wid) {
        Integer i = wordDao.addMyWord(uid, wid);
        return i;
    }

    @Override
    public Integer getWordByWid(int wid) {
        Integer i = wordDao.getWordByWid(wid);
        return i;
    }

    @Override
    public List<MyWord> getMyWord(int uid) {
        List<MyWord> myWord = wordDao.getMyWord(uid);
        return myWord;
    }

    @Override
    public Word getUnKnow(int wid) {
        Word unknowWord = wordDao.getUnknowWord(wid);
        return unknowWord;
    }

    @Override
    public int delMyWord(int uid, int wid) {
        int i = wordDao.delMyWord(uid, wid);
        return i;
    }

    @Override
    public List<Word> getEasyWord(int e) {
        List<Word> easyWord = wordDao.getEasyWord(e);
        return easyWord;
    }

    @Override
    public List<Word> getMidWord(int m) {
        List<Word> midWord = wordDao.getMidWord(m);
        return midWord;
    }

    @Override
    public List<Word> getHardWord(int h) {
        List<Word> hardWord = wordDao.getHardWord(h);
        return hardWord;
    }

}
